//  package com.sc.nft.controller;
//
//  import cn.hutool.core.collection.CollUtil;
//  import cn.hutool.core.collection.ListUtil;
//  import cn.hutool.core.convert.Convert;
//  import cn.hutool.core.date.DateField;
//  import cn.hutool.core.date.DateTime;
//  import cn.hutool.core.date.DateUtil;
//  import cn.hutool.core.util.IdcardUtil;
//  import cn.hutool.core.util.NumberUtil;
//  import cn.hutool.core.util.ObjectUtil;
//  import cn.hutool.core.util.StrUtil;
//  import com.google.common.collect.Maps;
//  import com.sc.nft.annotation.UserLogin;
//  import com.sc.nft.annotation.WithoutSign;
//  import com.sc.nft.controller.request.IdRequest;
//  import com.sc.nft.controller.request.PutCertificationRequest;
//  import com.sc.nft.dao.*;
//  import com.sc.nft.dto.*;
//  import com.sc.nft.entity.*;
//  import com.sc.nft.entity.dto.SaasTaskBurialPointDTO;
//  import com.sc.nft.entity.vo.UserWorkRoomExcludeWhiteListRankVO;
//  import com.sc.nft.enums.*;
//  import com.sc.nft.enums.task.TaskOrderTypeEnum;
//  import com.sc.nft.enums.task.TaskTypeEnum;
//  import com.sc.nft.exception.GlobalRunTimeException;
//  import com.sc.nft.helper.MessageQueueHelper;
//  import com.sc.nft.helper.MetaChainHepler;
//  import com.sc.nft.helper.UserPledgeRecordsHandler;
//  import com.sc.nft.pool.UserPool;
//  import com.sc.nft.service.*;
//  import com.sc.nft.sup.ErrorCode;
//  import com.sc.nft.sup.Result;
//  import com.sc.nft.util.WeChatUtil;
//  import io.swagger.annotations.Api;
//  import io.swagger.annotations.ApiOperation;
//  import lombok.RequiredArgsConstructor;
//  import lombok.extern.slf4j.Slf4j;
//  import org.redisson.api.RLock;
//  import org.springframework.data.redis.core.RedisTemplate;
//  import org.springframework.http.MediaType;
//  import org.springframework.util.CollectionUtils;
//  import org.springframework.web.bind.annotation.PostMapping;
//  import org.springframework.web.bind.annotation.RequestBody;
//  import org.springframework.web.bind.annotation.RequestMapping;
//  import org.springframework.web.bind.annotation.RestController;
//  import springfox.documentation.annotations.ApiIgnore;
//
//  import javax.annotation.Resource;
//  import javax.validation.Valid;
//  import java.math.BigDecimal;
//  import java.util.Date;
//  import java.util.List;
//  import java.util.Map;
//  import java.util.Objects;
//  import java.util.concurrent.Executors;
//  import java.util.concurrent.ScheduledExecutorService;
//  import java.util.concurrent.TimeUnit;
//
//  /**
//   * 服务控制器
//   *
//   * @author Sun
//   * @description 由 Mybatisplus Code Generator 创建
//   * @since 2022-05-29 10:36:55
//   */
//  @Slf4j
//  @RequiredArgsConstructor
//  @RestController
//  @RequestMapping("/sun")
//  @Api(tags = "测试")
//  //@ApiIgnore
//  public class SunTestController {
//      private final UserInfoService userInfoService;
//      private final UserInfoDao userInfoDao;
//
//      private final CheckParameterService checkParameterService;
//      private final UserBankCardDao userBankCardDao;
//      private final BlockChainTypeService blockChainTypeService;
//      private final OrderDao orderDao;
//      private final MessageQueueHelper MessageQueueHelper;
//      private final SecondOrderDao secondOrderDao;
//      private final UserWalletDao userWalletDao;
//      private final FilterIncomeListService filterIncomeListService;
//      private final UserCollectionService userCollectionService;
//      private final UserCollectionChainLogDao userCollectionChainLogDao;
//      private final UserChainInfoService userChainInfoService;
//      private final UserChainInfoDao userChainInfoDao;
//      private final UserCollectionDao userCollectionDao;
//      private final SecondCollectionConfigService secondCollectionConfigService;
//      private final DisassemblyHistoryLogDao disassemblyHistoryLogDao;
//      private final ReportBalanceService reportBalanceService;
//      private final ReportAmountService reportAmountService;
//      private final ReportTransferService reportTransferService;
//      private final ReportUserService reportUserService;
//      private final DigitalCollectionDao digitalCollectionDao;
//      private final MallIncomeService mallIncomeService;
//      private final MallOrderProductService mallOrderProductService;
//      private final MallOrderService mallOrderService;
//      private final MetaChainHepler metaChainHepler;
//
//      private final CollectionChainInitDetailsLogService collectionChainInitDetailsLogService;
//
//      private final UserPledgeRecordsDao userPledgeRecordsDao;
//      private final ChainCallBackLogDao chainCallBackLogDao;
//      private final UserWorkRoomDao userWorkRoomDao;
//      private final MerchantPledgeTaskSettlementRewardsLogService merchantPledgeTaskSettlementRewardsLogService;
//      private final UserMerchantPledgeTaskRecordsDao userMerchantPledgeTaskRecordsDao;
//      private final CarveUpPoolService carveUpPoolService;
//      private final ActivityBasicsService activityBasicsService;
//      private final PrizeDrawResultService prizeDrawResultService;
//      private final MallOrderStatusLogDao mallOrderStatusLogDao;
//      private final UserEcologyHatchRecordsDao userEcologyHatchRecordsDao;
//      private final UserEcologyHatchIncomeService userEcologyHatchIncomeService;
//      private final EcologyHatchIncomeConfDao ecologyHatchIncomeConfDao;
//      private final EcologyCollectionNodeConfDao ecologyCollectionNodeConfDao;
//      private final EcologySmeltingService ecologySmeltingService;
//      private final RedisTemplate redisTemplate;
//      private final EcologyHatchCollecionShareProfitConfDao ecologyHatchCollecionShareProfitConfDao;
//      private final EcologyHatchShareProfitDao ecologyHatchShareProfitDao;
//      private final EcologyHatchConfDao ecologyHatchConfDao;
//      private final EcologyHatchDaoIncomeConfDao ecologyHatchDaoIncomeConfDao;
//      private final UserEcologyHatchIncomeRecordDao userEcologyHatchIncomeRecordDao;
//      private final DigitalCollectionService digitalCollectionService;
//      private final MetaWalletService metaWalletService;
//      private final PayOrderDao payOrderDao;
//      private final SandTransferRecordDao sandTransferRecordDao;
//      private final DaoTransferDao daoTransferDao;
//      private final EcologyReforgeConfService ecologyReforgeConfService;
//      @Resource
//      private UserPledgeRecordsHandler userPledgeRecordsHandler;
//
//      @ApiOperation(value = "sendWeChatMessage", notes = "本地链容错处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/sendWeChatMessage", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result sendWeChatMessage() throws Exception {
//         WeChatUtil.sendWeChatMessage("test");
//          return Result.success();
//      }
//      @ApiOperation(value = "重铸商品库存回归", notes = "本地链容错处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/addProductStock", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result addProductStock(@RequestBody PutCertificationRequest request) throws Exception {
//          List<EcologyReforgeConf> list = ecologyReforgeConfService.getListByStatus(Boolean.TRUE);
//          list.forEach(ecologyReforgeConfService::addProductStock);
//          return Result.success();
//      }
//      @ApiOperation(value = "获取身份证年龄", notes = "本地链容错处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/getAgeByIdCard", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result getAgeByIdCard(@RequestBody PutCertificationRequest request) throws Exception {
//          int ageByIdCard = IdcardUtil.getAgeByIdCard(request.getCardId());
//          if(ageByIdCard < 18  ||  ageByIdCard >65){
//      throw new GlobalRunTimeException(StrUtil.format("年龄{},仅支持年满18周岁至65周岁",String.valueOf(ageByIdCard)));
//          }
//          return Result.success(ageByIdCard);
//      }
//      @ApiOperation(value = "本地链容错处理", notes = "本地链容错处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/testpluh", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result testpluh() throws Exception {
//          DateTime yesterday = DateUtil.yesterday();
//          DateTime yesterdayStartTime = DateUtil.beginOfDay(yesterday);
//          DateTime yesterdayEndTime = DateUtil.endOfDay(yesterday);
//          String payAmount =  payOrderDao.getPayAmount(yesterdayStartTime,yesterdayEndTime, PayTypeEnum.PAY);
//          String recAmount =  payOrderDao.getPayAmount(yesterdayStartTime,yesterdayEndTime, PayTypeEnum.RECHARGE);
////          String withAmount = sandTransferRecordDao.getSumAmount(yesterdayStartTime ,yesterdayEndTime);
//          String daoAmount = daoTransferDao.getSumSuccessAmount(yesterdayStartTime,yesterdayEndTime);
//          int addCzCount = userCollectionDao.getNewAddCount(yesterdayStartTime,yesterdayEndTime,DaoLevelTypeEnum.CITY_LORD.getCode());
//          int addJmCount = userCollectionDao.getNewAddCount(yesterdayStartTime,yesterdayEndTime, DaoLevelTypeEnum.RESIDENT.getCode());
//          int pay1000Count = payOrderDao.payUserCount(yesterdayStartTime,yesterdayEndTime);
//
//          String content = DateUtil.yesterday().toString("yyyy年MM月dd日")+"收支统计：\n"+
//                  "充值总金额："+recAmount+"元\n"+
//                  "银行卡支付："+payAmount+"元\n"+
////                  "用户提现总金额："+withAmount+"元\n"+
//                  "企业提现总金额："+daoAmount+"元\n"+
//                  "新增居民人数："+addJmCount+"人\n"+
//                  "新增城主人数："+addCzCount+"人\n"+
//                  "注册消费满1000人数:"+pay1000Count+"人";
//
//        System.out.println(content);
//          return Result.success();
//      }
//      @ApiOperation(value = "本地链容错处理", notes = "本地链容错处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/chainCallback", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result chainCallback() throws Exception {
//          List<ChainCallBackLog> list = chainCallBackLogDao.getListByStatus(ChainCallBackStatusEnum.TO_BE_PROCESSED, Boolean.TRUE);
//          list.forEach(chainCallBackLog -> {
//              try {
//                  userChainInfoService.chainCallback(chainCallBackLog);
//              } catch (Exception e) {
//                  throw new RuntimeException(e);
//              }
//          });
//          return Result.success();
//      }
//      @ApiOperation(value = "本地链容错处理", notes = "本地链容错处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/faultTolerantChainCallback", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result faultTolerantChainCallback() throws Exception {
//          //获取超过1个小时的链回调
//          List<ChainCallBackLog> list = chainCallBackLogDao.failListByOneHour();
//
//          list.forEach(chainCallBackLog -> {
//              try {
//                  userChainInfoService.faultTolerantChainCallback(chainCallBackLog);
//              } catch (Exception e) {
//                  throw new RuntimeException(e);
//              }
//          });
//          return Result.success();
//      }
//      @PostMapping(value = "/transferToMetaWallet", produces = MediaType.APPLICATION_JSON_VALUE)
//      @ApiOperation(value = "跨链转增", notes = "流转详情", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      public void transferToMetaWallet() throws Exception {
//          List<UserCollectionChainLog> collectionChainLogs = userCollectionChainLogDao.getByTypeAndStatus(UserChainTypeEnum.TO_META_WALLET, UserChainLogStatusEnum.WAIT);
//          collectionChainLogs.forEach(userChainInfoService::transferToMetaWallet);
//      }
//
//      @PostMapping(value = "/transferFromMetaWallettaWallet", produces = MediaType.APPLICATION_JSON_VALUE)
//      @ApiOperation(value = "跨链接受", notes = "流转详情", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      public void transferFromMetaWallettaWallet() throws Exception {
//          List<UserCollectionChainLog> collectionChainLogs = userCollectionChainLogDao.getByTypeAndStatus(UserChainTypeEnum.FROM_META_WALLET, UserChainLogStatusEnum.WAIT);
//          collectionChainLogs.forEach(userChainInfoService::transferFromMetaWallet);
//      }
//
//
//
//
//      @PostMapping(value = "/checkMetaWalletUeerArrd", produces = MediaType.APPLICATION_JSON_VALUE)
//      @ApiOperation(value = "校验地址", notes = "流转详情", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result  checkMetaWalletUeerArrd() throws IllegalAccessException {
//
//          metaWalletService.checkUeerArrd("0x13E31AF407F8167C689A2Da9CC292F981275e25b");
//
//          return Result.success();
//      }
//      @PostMapping(value = "/circulateDetails", produces = MediaType.APPLICATION_JSON_VALUE)
//      @ApiOperation(value = "流转详情", notes = "流转详情", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result<CirculateDetailsDTO>  circulateDetails(@Valid @RequestBody IdRequest request) {
//          return Result.success(digitalCollectionService.circulateDetails(request.getId()));
//      }
//
//
//      @ApiOperation(value = "微信推送", notes = "DAO-生态培育奖", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/testWeChant", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result testWeChant() throws Exception {
//          BigDecimal lastWeekSumIncome = userEcologyHatchIncomeRecordDao.getLastWeekSumIncome();
//          // 获取平台收益
//          List<EcologicalBenefitDTO> capturePlatformRevenueList = userEcologyHatchIncomeRecordDao.capturePlatformRevenue();
//          // 获取dao收益
//          List<EcologicalBenefitDTO> captureDaoRevenueList = userEcologyHatchIncomeRecordDao.captureDaoRevenue();
//              StringBuffer qyWxMessage = new StringBuffer();
//              qyWxMessage.append(StrUtil.format("{}发放总燃料:{}",DateUtil.format(DateTime.now(),"yyyy年MM月dd日"),lastWeekSumIncome.stripTrailingZeros().toPlainString()));
//              WeChatUtil.sendWeChatMessage(StrUtil.format("{}发放总燃料:{}",DateUtil.format(DateTime.now(),"yyyy年MM月dd日"),lastWeekSumIncome.stripTrailingZeros().toPlainString()));
//              StringBuffer capturePlatformRevenueMessage = new StringBuffer();
//              capturePlatformRevenueMessage.append(StrUtil.format("{}收益明细(平台):",DateUtil.format(DateTime.now(),"yyyy年MM月dd日"))+"\n");
//              for (int i = 0; i < capturePlatformRevenueList.size(); i++) {
//                  EcologicalBenefitDTO ecologicalBenefitDTO = capturePlatformRevenueList.get(i);
//                  if (i == 0){
//                      qyWxMessage.append(StrUtil.format(" 分红池:{},(平台)节省燃料:{}",ecologicalBenefitDTO.getBonusPoolAmount().setScale(2,BigDecimal.ROUND_DOWN).toPlainString(),ecologicalBenefitDTO.getAmountSaved().setScale(2,BigDecimal.ROUND_DOWN).toPlainString()));
//                  }
//                  capturePlatformRevenueMessage.append(ecologicalBenefitDTO.getIncomeName() + ":" + ecologicalBenefitDTO.getIncomeAmount().setScale(2,BigDecimal.ROUND_DOWN).toPlainString() + "\n");
//              }
//              WeChatUtil.sendWeChatMessage(qyWxMessage.toString());
//              WeChatUtil.sendWeChatMessage(capturePlatformRevenueMessage.toString());
//
//              StringBuffer captureDaoRevenueMessage = new StringBuffer();
//              captureDaoRevenueMessage.append(StrUtil.format("{}收益明细(DAO):",DateUtil.format(DateTime.now(),"yyyy年MM月dd日"))+"\n");
//              for (int i = 0; i < captureDaoRevenueList.size(); i++) {
//                  EcologicalBenefitDTO ecologicalBenefitDTO = captureDaoRevenueList.get(i);
//                  captureDaoRevenueMessage.append(ecologicalBenefitDTO.getIncomeName() + ":" + ecologicalBenefitDTO.getIncomeAmount().setScale(2,BigDecimal.ROUND_DOWN).toPlainString() + "\n");
//                  captureDaoRevenueMessage.append("分红池 :" + ecologicalBenefitDTO.getBonusPoolAmount().setScale(2,BigDecimal.ROUND_DOWN).toPlainString() + "\n");
//              }
//              WeChatUtil.sendWeChatMessage(captureDaoRevenueMessage.toString());
//
//          return Result.success();
//      }
//      @ApiOperation(value = "DAO-生态培育奖", notes = "DAO-生态培育奖", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/daoEcologyCultivateIncome", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result daoEcologyCultivateIncome() throws Exception {
//          List<EcologyHatchDaoIncomeConf> list = ecologyHatchDaoIncomeConfDao.getListByStatusAndType(EcologyIncomeTypeEnum.DAO_CULTIVATION_AWARD, Boolean.TRUE);
//          list.forEach(userEcologyHatchIncomeService::daoEcologyCultivateIncome);
//          return Result.success();
//      }
//
//
//      @ApiOperation(value = "DAO-生态贡献奖", notes = "DAO-生态贡献奖", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/daoEcologyContributionIncome", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result daoEcologyContributionIncome() throws Exception {
//          List<EcologyHatchDaoIncomeConf> list = ecologyHatchDaoIncomeConfDao.getListByStatusAndType(EcologyIncomeTypeEnum.DAO_CONTRIBUTION_AWARD, Boolean.TRUE);
//          list.forEach(userEcologyHatchIncomeService::daoEcologyContributionIncome);
//          return Result.success();
//      }
//
//
//
//      @ApiOperation(value = "分红池流入到钱包", notes = "分红池流入到钱包", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyBonusPoolFlowInto", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyBonusPoolFlowInto() throws Exception {
//          List<Long> ids = ecologyHatchConfDao.getDaoIdByConfCollectionId();
//          ids.forEach(userEcologyHatchIncomeService::ecologyBonusPoolFlowInto);
//          return Result.success();
//      }
//      @ApiOperation(value = "释放双方分账(每周三)", notes = "释放双方分账(每周三)", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyReleaseSeparateAccount", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyReleaseSeparateAccount() throws Exception {
//          ecologyHatchShareProfitDao.getListByType(EcologyHatchShareProfitTypeEnum.BOTH_PARTIES_ACCOUNT).forEach(ecologyHatchShareProfit -> {
//              userEcologyHatchIncomeService.ecologyDaoRelease(ecologyHatchShareProfit);
//          });
//          return Result.success();
//      }
//
//
//      @ApiOperation(value = "释放市值管理(每个月15号)", notes = "释放市值管理(每个月15号)", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyDaoRelease", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyDaoRelease() throws Exception {
//          ecologyHatchShareProfitDao.getListByType(EcologyHatchShareProfitTypeEnum.MARKET_VALUE_MANAGEMENT).forEach(ecologyHatchShareProfit -> {
//              userEcologyHatchIncomeService.ecologyDaoRelease(ecologyHatchShareProfit);
//          });
//          return Result.success();
//      }
//      @ApiOperation(value = "每日统计分成比例", notes = "每日统计分成比例", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyStatisticalProportion", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyStatisticalProportion() throws Exception {
//          ecologyHatchCollecionShareProfitConfDao.getListGroupCollectionIdByType(EcologyHatchShareProfitTypeEnum.BOTH_PARTIES_ACCOUNT).forEach(ecologyHatchCollecionShareProfitConf -> {
//              userEcologyHatchIncomeService.ecologyStatisticalProportion(ecologyHatchCollecionShareProfitConf);
//          });
//          return Result.success();
//      }
//      @ApiOperation(value = "熔炼后-分成处理", notes = "熔炼后-分成处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/divideInto", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result divideInto(@Valid @RequestBody IdRequest request) throws Exception {
//          UserEcologyHatchRecords userEcologyHatchRecords = userEcologyHatchRecordsDao.getById(request.getId());
//
//
//  //        log.info("熔炼 分成处理：{}", userEcologyHatchRecords.getId());
//  //
//  //        String key = RedisKeyEnum.ECOLOGY_HATCH_DIVIDE_INTO_TOPIC_LOCK.getKey() + userEcologyHatchRecords.getId();
//  //        Long increment = redisTemplate.opsForValue().increment(key);
//  //        redisTemplate.expire(key, 180, TimeUnit.MINUTES);
//  //        if (increment.longValue() > 1L) {
//  //            return Result.fail("已经处理过了");
//  //        }
//
//          try {
//              ecologySmeltingService.divideInto(userEcologyHatchRecords);
//          } catch (Exception e) {
//              log.error("熔炼 分成处理失败 记录id：{}", userEcologyHatchRecords.getId(), e);
//          }
//
//          return Result.success();
//      }
//
//
//      @ApiOperation(value = "熔炼后批量上周分成处理", notes = "熔炼后-分成处理", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/batchDivideInto", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result batchDivideInto() throws Exception {
//
//          List<UserEcologyHatchRecords> list = userEcologyHatchRecordsDao.getLastWeekData();
//
//          try {
//              list.forEach(ecologySmeltingService::divideInto);
//
//          } catch (Exception e) {
//              log.error("熔炼 分成处理失败", e);
//          }
//
//          return Result.success();
//      }
//
//
//      @ApiOperation(value = "直推结算(商户质押)", notes = "直推结算(商户质押)", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/getPledgeTaskSettlementRewards", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result getPledgeTaskSettlementRewards() throws Exception {
//          List<MerchantPledgeTaskSettlementRewardsLog> list = merchantPledgeTaskSettlementRewardsLogService.getPledgeTaskSettlementRewards();
//          list.forEach(merchantPledgeTaskSettlementRewardsLogService::pledgeTaskSettlementRewards);
//          return Result.success();
//      }
//
//      @ApiOperation(value = "自动质押", notes = "自动质押", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/quotaIncome", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result quotaIncome(@Valid @RequestBody IdRequest request) throws Exception {
//
//          return Result.success();
//      }
//      @ApiOperation(value = "自动质押", notes = "自动质押", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/autoUserMerchantPledgeTaskRecords", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result autoUserMerchantPledgeTaskRecords() throws Exception {
//          //自动质押
//          List<UserMerchantPledgeTaskRecords>  list = merchantPledgeTaskSettlementRewardsLogService.getExpireList();
//          list.forEach(merchantPledgeTaskSettlementRewardsLogService::autoUserMerchantPledgeTaskRecords);
//          return Result.success();
//      }
//      @ApiOperation(value = "生态报表", notes = "生态报表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/insertEcologyData", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result insertEcologyData() throws Exception {
//          reportUserService.insertEcologyData();
//          return Result.success();
//      }
//      @ApiOperation(value = "生态周期收益测试", notes = "测试生态收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/settleHatch", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result settleHatch() throws Exception {
//          userEcologyHatchIncomeService.settleHatch();
//          return Result.success();
//      }
//
//      @ApiOperation(value = "生态节点持仓奖", notes = "测试生态收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyNodeTakePsitionIncome", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyNodeTakePsitionIncome() throws Exception {
//          userEcologyHatchIncomeService.ecologyNodeTakePsitionIncome();
//          return Result.success();
//      }
//
//      @ApiOperation(value = "生态培育奖", notes = "测试生态收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyCultivateIncome", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyCultivateIncome() throws Exception {
//          userEcologyHatchIncomeService.ecologyCultivateIncome();
//          return Result.success();
//      }
//
//      @ApiOperation(value = "生态贡献奖", notes = "测试生态收益", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologyContributionIncome", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologyContributionIncome() throws Exception {
//          userEcologyHatchIncomeService.ecologyContributionIncome();
//          return Result.success();
//      }
//      @ApiOperation(value = "社区网点培育奖", notes = "社区网点培育奖", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/communityNetworkEcologicalCultivationAward", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result communityNetworkEcologicalCultivationAward() throws Exception {
//          userEcologyHatchIncomeService.communityNetworkEcologicalCultivationAward();
//          return Result.success();
//      }
//
//      @ApiOperation(value = "城市服务中心培育奖发放", notes = "城市服务中心培育奖发放", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/ecologicalCultivationOfUrbanServiceCenter", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result ecologicalCultivationOfUrbanServiceCenter() throws Exception {
//          userEcologyHatchIncomeService.ecologicalCultivationOfUrbanServiceCenter();
//          return Result.success();
//      }
//      @ApiOperation(value = "城市服务中心生态贡献奖", notes = "城市服务中心生态贡献奖", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/urbanServiceCenterEcologicalContribution", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result urbanServiceCenterEcologicalContribution() throws Exception {
//          userEcologyHatchIncomeService.urbanServiceCenterEcologicalContribution();
//          return Result.success();
//      }
//      private final IncomeService incomeService;
//      @ApiOperation(value = "测试直推", notes = "测试直推", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/testPush", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result testPush(@RequestBody IdRequest request) throws Exception {
//          Order id = orderDao.getById(request.getId());
//          incomeService.firstDirectPushIncome(id);
//          return Result.success();
//      }
//
//
//      @ApiOperation(value = "批量铸造", notes = "批量铸造", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/mintBatch", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result mintBatch() throws Exception {
//          List<DigitalCollection> collectionList = digitalCollectionDao.getListByChainStatusAndContractStatus(CollectionChainStatusEnum.ON_THE_CHAIN, CollectionContractStatusEnum.DEPLOY_SUCCESS);
//          for (DigitalCollection digitalCollection : collectionList) {
//              //获取待上链列表
//              List<CollectionChainInitDetailsLog> list = collectionChainInitDetailsLogService.metaChainInitListAndCollectionIdAndLimit(digitalCollection.getId(), UserChainLogStatusEnum.WAIT, CollectionChainDealStatusEnum.IN_CHINA, 100000);
//              if (ObjectUtil.isNotNull(list) && list.size() > 0) {
//                  List<List<CollectionChainInitDetailsLog>> partition = ListUtil.partition(list, 100);
//                  for (List<CollectionChainInitDetailsLog> collectionChainInitDetailsLogs : partition) {
//                      //上链逻辑
//                      userChainInfoService.mintBatch(collectionChainInitDetailsLogs);
//                  }
//              }
//          }
//          return Result.success();
//      }
//
//
//      private final SecondOrderService secondOrderService;
//      @ApiOperation(value = "二级test", notes = "二级test", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/secondtest", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result secondtest(@RequestBody IdRequest request) throws Exception {
//          secondOrderService.extracted(secondOrderDao.getById(request.getId()));
//          return Result.success();
//      }
//
//      private final UserPerformanceService userPerformanceService;
//      private final DaoShareConfigDao daoShareConfigDao;
//      private final MessageQueueHelper messageQueueHelper;
//      private final MallOrderRefundService mallOrderRefundService;
//      public static final String DATE_FORMAT="yyyyMMdd";
//
//      @ApiOperation(value = "二级test1", notes = "二级test1", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/secondtest1", produces = MediaType.APPLICATION_JSON_VALUE)
//      @WithoutSign
//      public Result secondtest1(@RequestBody IdRequest request) throws Exception {
//          SaasTaskBurialPointDTO saasTaskBurialPointDTO=new SaasTaskBurialPointDTO();
//          // 支付成功后.发送任务判定
//          messageQueueHelper.sendMessage(MessageTopic.DISK_TAKER,
//                  saasTaskBurialPointDTO.wallet(saasTaskBurialPointDTO.getUserId(),
//                          saasTaskBurialPointDTO.getTaskType(),
//                          Convert.toBigDecimal(saasTaskBurialPointDTO.getSchedule()),
//                          saasTaskBurialPointDTO.getVoluntarySum(),
//                          saasTaskBurialPointDTO.getConditionId(),saasTaskBurialPointDTO.getOrderId()));
//          return Result.success();
//      }
//
//      @ApiOperation(value = "链上交易", notes = "链上交易", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/transfer", produces = MediaType.APPLICATION_JSON_VALUE)
//      public Result transfer(@RequestBody SaasTaskBurialPointDTO saasTaskBurialPointDTO) throws Exception {
//          // 支付成功后.发送任务判定
//          messageQueueHelper.sendMessage(MessageTopic.DISK_TAKER,
//                  saasTaskBurialPointDTO.wallet(saasTaskBurialPointDTO.getUserId(),
//                          saasTaskBurialPointDTO.getTaskType(),
//                          Convert.toBigDecimal(saasTaskBurialPointDTO.getSchedule()),
//                          saasTaskBurialPointDTO.getVoluntarySum(),
//                          saasTaskBurialPointDTO.getConditionId(),saasTaskBurialPointDTO.getOrderId()));
//          return Result.success();
//      }
//
//
//      private final DigitalCollectionProductInfoSubscribeDao digitalCollectionProductInfoSubscribeDao;
//      private final DigitalCollectionProductInfoSubscribeCodeService digitalCollectionProductInfoSubscribeCodeService;
//      private final DigitalCollectionProductInfoSubscribeWinBallotDao digitalCollectionProductInfoSubscribeWinBallotDao;
//
//
//      private ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
//      @ApiOperation(value = "抽钱定时任务", notes = "抽钱定时任务", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
//      @PostMapping(value = "/drawLots", produces = MediaType.APPLICATION_JSON_VALUE)
//      @WithoutSign
//      public Result drawLots() throws Exception {
////          DateTime offset = DateTime.now().offset(DateField.SECOND, 30);//未来30秒
////          List<DigitalCollectionProductInfoSubscribe> digitalCollectionProductInfoSubscribes = digitalCollectionProductInfoSubscribeDao.drawLots(offset);
////          // 获取开启时间在30秒内的抽签商品
////          digitalCollectionProductInfoSubscribes.forEach(digitalCollectionProductInfoSubscribe -> {
////              try{
////                  long delayInSeconds = calculateDelayInSeconds(digitalCollectionProductInfoSubscribe.getConsistenceStartTime());
////                  executor.schedule(() ->digitalCollectionProductInfoSubscribeCodeService.drawLots(digitalCollectionProductInfoSubscribe.getProductId()), delayInSeconds, TimeUnit.SECONDS);
////              }catch (Exception e){
////                  log.error("时间轮抽签失败:",e);
////              }
////          });
//
//          reportBalanceService.insertReportBalanceNewEdition();
//          reportBalanceService.insertReportBalance();
//
//
//          return Result.success();
//      }
//      private long calculateDelayInSeconds(Date completeTime) {
//          long currentTime = System.currentTimeMillis();
//          long targetTime = completeTime.getTime();
//          return (targetTime - currentTime) / 1000; // 转换为秒
//      }
//  }
//
//
//
